package com.group9.handinhand.service.so;

import org.apache.commons.lang.ArrayUtils;

import com.group9.handinhand.dao.model.CommunityTag;
/**
 * Class for service of community tags
 *
 */
public class CommunityTagSO extends AbstractBaseSO {
	
    private TagSO tag;
	private CommunitySO community;
	/**
	 * converts the community tag model object
	 * @param ignoreProperties
	 * @return
	 */
	public CommunityTag convertToModelObject(String... ignoreProperties) {
		CommunityTag model = (CommunityTag) convert(new CommunityTag(),
				(String[]) ArrayUtils.addAll(ignoreProperties, new String[]{}));
		model.setCommunity(this.community.convertToModelObject());
		model.setTag(this.tag.convertToModelObject());
		return model;
	}

	public TagSO getTag() {
		return tag;
	}

	public void setTag(TagSO tag) {
		this.tag = tag;
	}

	public CommunitySO getCommunity() {
		return community;
	}

	public void setCommunity(CommunitySO community) {
		this.community = community;
	}

	@Override
	public String toString() {
		return "CommunityTagSO [tag=" + tag + ", community=" + community + "]";
	}
	
	
}
